package com.winxuan.channel.model.commodity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name="commodity_snapshot")
public class CommoditySnap implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -1441526099526201234L;


	@EmbeddedId
	private CommoditySnapPK commoditySnapPK;
	@Column(name = "distributecommodity")
	private String distributeCommodity;
	@Column(name = "name")
	private String name;
	@Column(name = "price")
	private BigDecimal price;
	@Column(name = "isonshelf")
	private boolean onshelf;
	@Column(name = "stock")
	private Integer stock;
	@Column(name = "coversdigest")
	private String coversdigest;
	@Column(name = "descriptiondigest")
	private String descriptiondigest;
	@Column(name = "createtime")
	private Date createtime;
	@Column(name = "lastupdatetime")
	private Date lastupdatetime;


	public String getDistributeCommodity() {
		return distributeCommodity;
	}
	public void setDistributeCommodity(String distributeCommodity) {
		this.distributeCommodity = distributeCommodity;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public BigDecimal getPrice() {
		return price;
	}
	public void setPrice(BigDecimal price) {
		this.price = price;
	}
	public boolean isOnshelf() {
		return onshelf;
	}
	public void setOnshelf(boolean onshelf) {
		this.onshelf = onshelf;
	}
	public Integer getStock() {
		return stock;
	}
	public void setStock(Integer stock) {
		this.stock = stock;
	}
	public String getCoversdigest() {
		return coversdigest;
	}
	public void setCoversdigest(String coversdigest) {
		this.coversdigest = coversdigest;
	}
	public String getDescriptiondigest() {
		return descriptiondigest;
	}
	public void setDescriptiondigest(String descriptiondigest) {
		this.descriptiondigest = descriptiondigest;
	}
	public Date getCreatetime() {
		return createtime;
	}
	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}
	public Date getLastupdatetime() {
		return lastupdatetime;
	}
	public void setLastupdatetime(Date lastupdatetime) {
		this.lastupdatetime = lastupdatetime;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	public CommoditySnapPK getCommoditySnapPK() {
		return commoditySnapPK;
	}
	public void setCommoditySnapPK(CommoditySnapPK commoditySnapPK) {
		this.commoditySnapPK = commoditySnapPK;
	}

	public boolean equals(Object o) {
		if ( this == o ) return true;
		if ( !( o instanceof CommoditySnapPK ) ) return false;
		final CommoditySnap snap = (CommoditySnap) o;
		if ( !commoditySnapPK.equals( snap.commoditySnapPK ) ) return false;
		return true;
	}

	public int hashCode() {
		return commoditySnapPK.hashCode();
	}

}
